#ifndef _MICROPHONE_H_
#define _MICROPHONE_H_

//#define MICROPHONE0_ADC_PIN ADC0_CH01_P06_1
//#define MICROPHONE1_ADC_PIN ADC1_CH00_P10_4
//#define MICROPHONE2_ADC_PIN ADC1_CH24_P14_4
//#define MICROPHONE3_ADC_PIN ADC1_CH09_P12_5

#define MICROPHONE0_ADC_PIN ADC1_CH09_P12_5
#define MICROPHONE1_ADC_PIN ADC1_CH24_P14_4 
#define MICROPHONE2_ADC_PIN ADC1_CH00_P10_4
#define MICROPHONE3_ADC_PIN ADC0_CH01_P06_1

#define DATA_NUMBER (2048)
#define FFT_DATA_NUMBER (2*DATA_NUMBER)
#define FRE_MICROPHONE (10000)
#define ENVIRONMENT_SOUND (1970)

typedef union{
  int32_t int32_type;
  uint32_t uint32_type;
}ui32andi32;

/*
typedef struct Complex
{
  double x,y;
} complex;
extern complex microphone_data_buffer[4][NUM_OF_MICROPHONE_DATA+BUFFER_HUANCHONG];
extern uint16 index_of_microphone_buffer;
//#define PI 3.14159
//void DFT_wave_data(complex A[],int n,int typ,int index);
//int wave_direction_prase(void);
//void spawnrev(int n);
//void read_microphone_to_buffer();
//void microphone_dataconvert_enable();
*/
void microphone_init();
void micro_servo();
int voice_process();
void micro_prase_pit_handler();
int voice_test();
void sound_location_new(float32_t micro_data[][4*DATA_NUMBER],ui32andi32 data[2]);
#endif